package hgx.spring.cloud.lession.orderserver.vo;/**
 * Created by liujun on 2018/3/15.
 */

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * @author Administrator
 * @create 2018-03-15 15:34
 */
public class OrderVo implements Serializable {
    private static final long serialVersionUID = -8857306229912548211L;

    private Long id;

    private Long userId;

    private Set<OrderItemVo> orderItemPos;

    private float totalMoney;

    private byte status;

    private Date createDate;

    private Date updateDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Set<OrderItemVo> getOrderItemPos() {
        return orderItemPos;
    }

    public void setOrderItemPos(Set<OrderItemVo> orderItemPos) {
        this.orderItemPos = orderItemPos;
    }

    public void addOrderItemVo(OrderItemVo orderItemVo){
        if(orderItemVo == null){
            return ;
        }

        if(orderItemPos == null){
            orderItemPos=new HashSet<OrderItemVo>();
        }
        orderItemPos.add(orderItemVo);

    }

    public float getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(float totalMoney) {
        this.totalMoney = totalMoney;
    }

    public byte getStatus() {
        return status;
    }

    public void setStatus(byte status) {
        this.status = status;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public String toString() {
        return "OrderVo{" +
                "id=" + id +
                ", userId=" + userId +
                ", orderItemPos=" + orderItemPos +
                ", totalMoney=" + totalMoney +
                ", status=" + status +
                ", createDate=" + createDate +
                ", updateDate=" + updateDate +
                '}';
    }
}
